layui.use(['table','jquery','form','layer','laydate','upload','element'],function () {
    var table = layui.table;
    var $ = layui.jquery;
    var form = layui.form;
    var layer = layui.layer;
    var laydate = layui.laydate;
    var upload = layui.upload;
    var element = layui.element;

    laydate.render({
        elem:"#entranceDate",
        type:"datetime",
        tigger:'click'
    });

    laydate.render({
        elem:"#graduationDate",
        type:"datetime",
        tigger:'click'
    });

    laydate.render({
        elem:"#createDate",
        type:"datetime",
        tigger:'click'
    });

    /*点击修改结束*/
    //修改图片
    upload.render({
        elem:'#avatarUrl',
        url: "/upload/uploadFile",
        field: "files",
        accept: "images",
        acceptMime: 'image/*',
        done: function (res, index, upload) {
            if (res.code == 0) {
                var mainImage = res.data.path;
                localStorage.setItem("mainImage",mainImage);
                $('#avatarUrl').attr('src', "http://"+mainImage);
            }
        },
        progress: function (n, elem, e) {
            element.progress('demo', n + '%');
            if (n == 100) {
                layer.msg('上传完毕', {icon: 1});
            }
        }
    });
});